//package com.wzy.level.user.userServlet;
//
//import com.wzy.Jdbc封装.config.R;
//import com.wzy.Jdbc封装.pojo.News_user;
//import com.wzy.level.user.userService.userService;
//import com.wzy.level.user.userServiceImpl.userServiceImpl;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import javax.xml.transform.Result;
//import java.io.IOException;
//import java.io.PrintWriter;
//
//
//public class text {
//    @RequestMapping(path="/login",method = RequestMethod.GET)
//    @ResponseBody
//    public R login(@RequestParam("username") String username, @RequestParam("password") String password ) throws IOException {
//        News_user news_user = new News_user(username,password);
//        userService userService = new userServiceImpl();
//        News_user news_user1 = userService.selectByUsername(username);
//        HttpServletResponse resp=null;
//        HttpServletRequest req = null;
//        HttpSession session = req.getSession();
//        Integer state = 0;
//        String message  = null;
//        if(news_user1.getPassword().equals(password) ){
//            state = 200;
//            session.setAttribute("user",news_user);
//            resp.sendRedirect(req.getContextPath()+"/index.jsp");
//        }else {
//            state = 404;
//            resp.sendRedirect(req.getContextPath()+"/Login.jsp");
//        }
//        return state==200 ?R.ok():R.error("登录失败");
//    }
//
//}
